<?php

/*
* Request implement`
*/
class Request{
	/*
	* param name contains controller
	*/
	private static $controllerParamName = 'controller';
	/*
	* paramname contains action
	*/
	private static $actionParamName = 'action';
	/*
	* default controller is 'main'
	*/
	private static $controllerName = 'Main';
	/*
	* default action is 'view'
	*/
	private static $actionName = 'Index';

	/*
	* method return controller name
	*/
	public static function GetController(){
		if (isset($_GET[self::$controllerParamName]) && !is_numeric($_GET[self::$controllerParamName]))
		   self::$controllerName = $_GET[self::$controllerParamName];
		return ucwords(self::$controllerName);			
	}

	/*
	* method return action name
	*/
	public static function GetAction(){	
		if(isset($_GET[self::$actionParamName]) && !is_numeric($_GET[self::$actionParamName]))
			self::$actionName = $_GET[self::$actionParamName];
		return ucwords(self:: $actionName);
	}
	
	/*
	* GET
	* method return param value from request by name
	*/
	public static function GetParamValueByGet($paramName){
		if(isset($_GET[$paramName]))
			return  $_GET[$paramName];		
	}

	/*
	* POST
	* method return param value from request by name
	*/
	public static function GetParamValueByPost($paramName){
		if(isset($_POST[$paramName]))
			return $_POST[$paramName];
	}
	
}
?>
